<html>
<head><meta charset="utf-8"><title>homebrew target bikeshedding · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html">homebrew target bikeshedding</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204270059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204270059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204270059">(Jul 17 2020 at 23:14)</a>:</h4>
<p>(initially written as a reply to <span class="user-mention" data-user-id="239881">@Josh Triplett</span> on <a href="https://github.com/rust-lang/rust/pull/74419">https://github.com/rust-lang/rust/pull/74419</a>, realized it'd probably fit better here)<br>
3DS and Switch would likely share very little code. There are currently no non-newlib-based 3DS toolchains, however, there are multiple for the Switch. However, for the 3DS, a pure Rust target would be feasible to implement and probably make more sense than a newlib one, it'd just be much more difficult since it couldn't share code with Unix targets. For the Switch, these toolchains exist:</p>
<ul>
<li>DevkitA64: Made up of libnx, a heavily modified newlib fork, and a slightly modified gcc fork. I have a mostly functional Rust target for this, it'd just need some cleanup, testing, and a rebase to be upstreamed. Only supports statically linked binaries (no shared libraries or dynamically linked binaries).</li>
<li>libtransistor: Mostly dead toolchain based on clang, some developers moved to MegatonHammer/DevkitA64.</li>
<li>Skyline: Game modding toolkit containing a Rust toolchain dynamically linking against Nintendo's proprietary C library. Could likely be used with the official toolchain with only linking-related changes, though obviously I can't say for sure. Only supports linking shared libraries, which isn't a fundamental limitation but there isn't much interest in using Nintendo's SDK for homebrew outside game modding.</li>
<li>MegatonHammer: Deprecated project providing a pure-Rust toolchain for the Switch. Replaced by SunriseOS's userspace toolchain.</li>
<li>SunriseOS: WIP open source pure-Rust implementation of the Nintendo Switch kernel and toolchain, currently both targeting i386. It also includes a minimal userspace, but that exists for the primary purpose of testing the other two. While an aarch64 kernel port is a goal, it isn't an immediate one. An aarch64 port of its toolchain ABI-compatible with the official Switch kernel should hopefully happen in the relatively near future, however. </li>
</ul>
<p>I know that there is interest in upstreaming DevkitA64, Skyline, and (once complete) Sunrise targets. What are your thoughts on this?</p>



<a name="204270985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204270985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204270985">(Jul 17 2020 at 23:30)</a>:</h4>
<p>That sounds reasonable to me.</p>



<a name="204271099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271099">(Jul 17 2020 at 23:32)</a>:</h4>
<p>Generally speaking, I would be <em>hesitant</em> to accept a toolkit that would be primarily used for modding proprietary games, just because that could get into legally murky territory. (e.g. someone filing a bug report on rust-lang/rust referencing a mod to a game, which seems very likely to be ROM-adjacent.)</p>



<a name="204271107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271107">(Jul 17 2020 at 23:32)</a>:</h4>
<p>I'm not saying we wouldn't take it, I'm saying it would raise questions. :)</p>



<a name="204271122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271122">(Jul 17 2020 at 23:32)</a>:</h4>
<p>The other two wouldn't raise any eyebrows.</p>



<a name="204271152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271152">(Jul 17 2020 at 23:33)</a>:</h4>
<p>Roughly speaking, I think it would make sense to call those something like <code>aarch64-nintendo-switch-devkita64</code>, <code>aarch64-nintendo-switch-skyline</code>, and <code>aarch64-nintendo-switch-sunrise</code>.</p>



<a name="204271186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271186">(Jul 17 2020 at 23:33)</a>:</h4>
<p>Does those names sound reasonable to you?</p>



<a name="204271205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271205">(Jul 17 2020 at 23:33)</a>:</h4>
<p>It does.</p>



<a name="204271268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271268">(Jul 17 2020 at 23:34)</a>:</h4>
<p>The main thing I'm unsure of is how related the DevkitA64 target is to newlib targets.</p>



<a name="204271299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271299">(Jul 17 2020 at 23:35)</a>:</h4>
<p>(however, currently the newlib support in the libc crate is limited to old attempts at 3DS and Switch targets...)</p>



<a name="204271326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271326">(Jul 17 2020 at 23:35)</a>:</h4>
<p>I think that because of the origins of the fourth component of target "triples", to distinguish "linux-gnu" meaning "linux with glibc" as compared to "linux with some other C library", targets are a little fixated on the fourth component being "C library".</p>



<a name="204271338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271338">(Jul 17 2020 at 23:36)</a>:</h4>
<p>I think it doesn't matter as much if it uses newlib or some other library, it matters what overall environment it's expected to fit into.</p>



<a name="204271385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271385">(Jul 17 2020 at 23:36)</a>:</h4>
<p>Two different targets using newlib might still have different target names, because code for those targets is expected to link to different libraries.</p>



<a name="204271419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271419">(Jul 17 2020 at 23:37)</a>:</h4>
<p>One other thing I'm unsure of is how to handle i386 Sunrise. While I'm not sure if there's any plans to upstream i386 Sunrise, <code>i386-nintendo-switch-sunrise</code> wouldn't make much sense because it's neither Nintendo nor the Switch, and it'd be nice if there was consistency between aarch64 and i386 Sunrise.</p>



<a name="204271513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271513">(Jul 17 2020 at 23:38)</a>:</h4>
<p>Would Sunrise still implement the same syscalls and similar that the Switch OS does?</p>



<a name="204271532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271532">(Jul 17 2020 at 23:39)</a>:</h4>
<p>(Also, i386 or x86_64?)</p>



<a name="204271535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271535">(Jul 17 2020 at 23:39)</a>:</h4>
<p>i386, I don't believe there's any plans for x86_64 support.</p>



<a name="204271544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271544">(Jul 17 2020 at 23:39)</a>:</h4>
<p>It would, yes.</p>



<a name="204271546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271546">(Jul 17 2020 at 23:39)</a>:</h4>
<p>Huh. Even though the target for the Switch uses 64-bit ARM?</p>



<a name="204271570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271570">(Jul 17 2020 at 23:40)</a>:</h4>
<p>Yeah, Sunrise started as a school project to implement an i386 kernel.</p>



<a name="204271612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271612">(Jul 17 2020 at 23:40)</a>:</h4>
<p>Go figure.</p>



<a name="204271616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271616">(Jul 17 2020 at 23:40)</a>:</h4>
<p>That's kinda awesome.</p>



<a name="204271635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271635">(Jul 17 2020 at 23:40)</a>:</h4>
<p>So, despite the precedent for things like <code>-sony-psp</code>, I'm wondering if maybe for legal reasons we <em>shouldn't</em> say <code>nintendo-switch</code>.</p>



<a name="204271654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271654">(Jul 17 2020 at 23:41)</a>:</h4>
<p>It'd be <em>accurate</em>, but I could also very easily imagine the C&amp;D-happy Nintendo complaining about the use of the name, and in particular that it implies some kind of endorsement.</p>



<a name="204271670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271670">(Jul 17 2020 at 23:41)</a>:</h4>
<p>I was wondering the same. What do other toolchains do here?</p>



<a name="204271685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271685">(Jul 17 2020 at 23:41)</a>:</h4>
<p>For what it's worth, the Switch supports both aarch32 and aarch64 applications, but there's very little interest from homebrew developers in aarch32 (pretty much all official aarch32 applications are ports from the 32-bit Wii U).</p>



<a name="204271750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271750">(Jul 17 2020 at 23:42)</a>:</h4>
<p>Interesting. (Massive side note: how much do the Wii U and the Switch have in common, in terms of being able to port an application from one to the other?)</p>



<a name="204271812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271812">(Jul 17 2020 at 23:43)</a>:</h4>
<p>Very little, they have completely unrelated operating systems. The Wii U is also big-endian PowerPC, while the Switch is little-endian ARM.</p>



<a name="204271827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271827">(Jul 17 2020 at 23:43)</a>:</h4>
<p>Ah.</p>



<a name="204271843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271843">(Jul 17 2020 at 23:43)</a>:</h4>
<p>So why does aarch32 make sense for porting WiiU software? Just because people make assumptions that 64-bit breaks?</p>



<a name="204271910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271910">(Jul 17 2020 at 23:44)</a>:</h4>
<p>I'm guessing so, yeah. I don't know for sure, but that's what would make the most sense to me.</p>



<a name="204271924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271924">(Jul 17 2020 at 23:44)</a>:</h4>
<p>I think we might be back on-topic for the thread, with the concern about target naming.</p>



<a name="204271941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271941">(Jul 17 2020 at 23:45)</a>:</h4>
<p>Looking at some other Rust homebrew toolchains, N64 uses <code>mips-nintendo64-none</code> while the Wii uses <code>powerpc-unknown-eabi</code>.</p>



<a name="204271963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204271963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204271963">(Jul 17 2020 at 23:45)</a>:</h4>
<p>Are either of those in-tree?</p>



<a name="204272038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272038">(Jul 17 2020 at 23:46)</a>:</h4>
<p>No. From what I've seen, most homebrew targets don't require any compiler changes beyond the target spec, so it's generally preferred to use a target JSON and Xargo.</p>



<a name="204272042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272042">(Jul 17 2020 at 23:46)</a>:</h4>
<p>The proposed GBA target is actually so similar to what a generic thumbv4 embedded target would look like, that we could instead turn it into just that – and avoid any naming questions altogether.</p>



<a name="204272067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272067">(Jul 17 2020 at 23:47)</a>:</h4>
<p>Is there value in having the target know something about the environment?</p>



<a name="204272071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272071">(Jul 17 2020 at 23:47)</a>:</h4>
<p>For a Switch target, I'd expect an actual operating system and syscalls, so it's not generic.</p>



<a name="204272128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272128">(Jul 17 2020 at 23:48)</a>:</h4>
<p>The Switch and 3DS are microkernels so it'd be more IPC than syscalls, but your point still stands.</p>



<a name="204272135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272135">(Jul 17 2020 at 23:48)</a>:</h4>
<p>For the GBA, would the standard library or similar make calls into the firmware, invoke interrupts, rely on memory layout or peripherals, or otherwise make assumptions about the environment that would not be true of a completely generic armv4/thumbv4 target?</p>



<a name="204272143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272143">(Jul 17 2020 at 23:49)</a>:</h4>
<p>Yeah. For the GBA less so, it's basically a bare-metal embedded target from what I understand.</p>



<a name="204272161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272161">(Jul 17 2020 at 23:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/homebrew.20target.20bikeshedding/near/204272135">said</a>:</p>
<blockquote>
<p>For the GBA, would the standard library or similar make calls into the firmware, invoke interrupts, rely on memory layout or peripherals, or otherwise make assumptions about the environment that would not be true of a completely generic armv4/thumbv4 target?</p>
</blockquote>
<p>Not any more than the existing generic thumb targets I think</p>



<a name="204272213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272213">(Jul 17 2020 at 23:50)</a>:</h4>
<p>Then in that case, it might make sense to make it a generic target. I'll leave you to argue that with <span class="user-mention" data-user-id="224471">@Lokathor</span>. ;)</p>



<a name="204272235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272235">(Jul 17 2020 at 23:50)</a>:</h4>
<p>I doubt it. The GBA <em>does</em> have a BIOS, but the only thing it provides that could be useful for libcore is a memcpy, and the overhead from interrupts would probably make using it over a Rust one somewhat pointless.</p>



<a name="204272357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272357">(Jul 17 2020 at 23:53)</a>:</h4>
<p>The only usecase I'd see for a separate GBA target is for a GBA MMIO crate to <code>compiler_error!</code> if it's not being used on a GBA, but that's not a very major motivation.</p>



<a name="204272375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272375">(Jul 17 2020 at 23:53)</a>:</h4>
<p>The GBA has a BIOS which has a limited selection of things you can do, but it's more like a grab-bag of routines Nintendo thought that GBA developers would consider useful, not anything at all like a C standard library.</p>



<a name="204272422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272422">(Jul 17 2020 at 23:54)</a>:</h4>
<p>The BIOS is a good point – however as long as you don't hook it up to compiler_builtins it can probably be exposed from some library instead of requiring toolchain support</p>



<a name="204272425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272425">(Jul 17 2020 at 23:54)</a>:</h4>
<p>And yes, my exact reason in wanting to have a GBA target was for <code>cfg</code> related reasons.</p>



<a name="204272441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272441">(Jul 17 2020 at 23:55)</a>:</h4>
<p>Would you expect that any of those BIOS routines would be actually called in the standard library?</p>



<a name="204272464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272464">(Jul 17 2020 at 23:55)</a>:</h4>
<p>Or, would you expect that such <code>cfg</code> usage would occur in the standard library, or only in the ecosystem?</p>



<a name="204272504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272504">(Jul 17 2020 at 23:56)</a>:</h4>
<p>(the BIOS would) Never (be called by <code>std</code>), they're like.. lz77 decompression and a slightly fast memset sort of thing, and a sound driver system thing, nothing at all close to what the Rust standard library considers to be "standard"</p>



<a name="204272547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272547">(Jul 17 2020 at 23:57)</a>:</h4>
<p><del>Despite the name, that's actually a memcpy, not a memset.</del> (it's actually both for some reason)</p>



<a name="204272636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272636">(Jul 17 2020 at 23:58)</a>:</h4>
<p>well whatever :P it's a bunch of random junk that would never be called by any sort of Rust standard library, core or std</p>



<a name="204272665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272665">(Jul 17 2020 at 23:59)</a>:</h4>
<p>The main reason for the <code>cfg</code> support being wanted was for the <code>gba</code> crate to be able to declare the MMIO stuff and then mark the volatile reads and writes as safe operations because you "know" you're targeting a GBA. Otherwise you're just marking a bunch of volatile accesses as safe and <em>just hoping</em> that the user runs them on a GBA.</p>



<a name="204272699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272699">(Jul 17 2020 at 23:59)</a>:</h4>
<p>Perhaps standardizing on <code>--target thumbv4t-none-eabi --cfg gba</code> could be a reasonable compromise?</p>



<a name="204272701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272701">(Jul 17 2020 at 23:59)</a>:</h4>
<p>I'd have to double check but I admit that we <em>probably</em> could turn it into a completely standard <code>thumbv4t-none-eabi</code>target profile</p>



<a name="204272807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272807">(Jul 18 2020 at 00:00)</a>:</h4>
<p>This is a similar idea to <code>--cfg procmacro2_semver_exempt</code>, which seems to generally be considered a reasonable idea.</p>



<a name="204272822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272822">(Jul 18 2020 at 00:01)</a>:</h4>
<p>I probably wouldn't worry about that – the entire embedded ecosystem doesn't (and couldn't) deal with that, it just assumes that you use the right peripheral access crate for your target</p>



<a name="204272925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204272925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204272925">(Jul 18 2020 at 00:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/homebrew.20target.20bikeshedding/near/204271654">said</a>:</p>
<blockquote>
<p>It'd be <em>accurate</em>, but I could also very easily imagine the C&amp;D-happy Nintendo complaining about the use of the name, and in particular that it implies some kind of endorsement.</p>
</blockquote>
<p>Since we seem to have solved this for the GBA, any ideas for how to handle this for other targets?</p>



<a name="204273040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204273040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204273040">(Jul 18 2020 at 00:04)</a>:</h4>
<p>call it <code>mimtemdo</code> instead, nobody will know /s</p>



<a name="204273526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204273526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204273526">(Jul 18 2020 at 00:12)</a>:</h4>
<p>I think I'd agree with just having a generic arm4 baremetal target + a GBA crate. seems to follow the methodology of most baremetal board's mmio handling</p>



<a name="204273543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204273543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204273543">(Jul 18 2020 at 00:12)</a>:</h4>
<p>the nintendo cereal commercial has the line "Nin-ten-do, it's a cereal now!", so clearly we codename it "cereal"</p>



<a name="204274262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274262">(Jul 18 2020 at 00:27)</a>:</h4>
<p>Oh I'd also like to add to the mention of skyline</p>



<a name="204274273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> roblabla <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274273">(Jul 18 2020 at 00:27)</a>:</h4>
<p>SunriseOS and Megaton Hammer creator here. The current sunriseos target triple is <code>i386-unknown-sunrise</code> to avoid this whole issue entirely ^^. Megaton-Hammer used the <code>aarch64-roblabla-switch</code> triple. IMO the ideal situation for the Nintendo Switch specifically would be to unify all triples under <code>aarch64-switch-&lt;environment&gt;</code>, where environment can be libnx, libtransistor, nintendo (or whatever name makes sense for nintendo's proprietary framework) and sunrise. This way, switch-specific but toolchain-independant code can be cfg'd with <code>target_os = "switch"</code>, while target-dependant code can use <code>target_env = "sunrise"</code>. </p>
<p>FWIW though, I don't plan on ever upstreaming SunriseOS targets into rustc. I've got an OK system set up to patch my libstd modifications in (applying patches to rust-src, and using xargo to build it), and I don't think the upsides of having it in-tree would justify the maintenance burden. Besides, I'm basically the only user, and I don't expect this to change ever X).</p>



<a name="204274318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274318">(Jul 18 2020 at 00:28)</a>:</h4>
<p>what leo referred to as "skyline" is actually "skyline-rs", which is essentially a Rust fork designed around linking as if you're an official nintendo binary</p>



<a name="204274325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274325">(Jul 18 2020 at 00:28)</a>:</h4>
<p>(not using any SDK stuff, entirely just reverse engineered)</p>



<a name="204274475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274475">(Jul 18 2020 at 00:31)</a>:</h4>
<p>You mean <code>aarch64-nintendo-switch-environment</code>/<code>aarch64-none-switch-environment</code>? Also, I feel like there would be plenty of other people (at least myself) who would be interested in an aarch64 sunrise-libuser target, even if not an i386 SunriseOS target.</p>



<a name="204274526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274526">(Jul 18 2020 at 00:32)</a>:</h4>
<p>and I would be interested in upstreaming it, but I'm not sure if it'd resemble a homebrew/modding target or treat it as if it's official since it <em>could</em> be used for actual games</p>



<a name="204274626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274626">(Jul 18 2020 at 00:34)</a>:</h4>
<p>To be fair, that's true for libnx too in theory, the question is whether Nintendo would allow it :P</p>



<a name="204274628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> roblabla <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274628">(Jul 18 2020 at 00:34)</a>:</h4>
<p><span class="user-mention" data-user-id="239001">@leo60228</span> Yeah, I mean, either works. If putting <code>nintendo</code> in the target is a big nono for legal reasons, then <code>none</code> would work just as well. FWIW there's already precedent in using <code>target_os = "switch"</code>, see <a href="https://github.com/rust-lang/libc/blob/master/src/lib.rs#L114">libc</a></p>



<a name="204274636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274636">(Jul 18 2020 at 00:35)</a>:</h4>
<p>I vaguely recall hearing about a commercial GBA game using DevkitARM?</p>



<a name="204274641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274641">(Jul 18 2020 at 00:35)</a>:</h4>
<p><span class="user-mention" data-user-id="239001">@leo60228</span> actually it's not true of libnx... it'll fuck up sdk TLS stuff</p>



<a name="204274806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274806">(Jul 18 2020 at 00:38)</a>:</h4>
<p>I'll go ahead with using the triple <code>aarch64-unknown-switch-devkita64</code> for now.</p>



<a name="204274855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274855">(Jul 18 2020 at 00:39)</a>:</h4>
<p>and maybe for skyline an equivalant triple would be aarch64-unknown-switch-nnsdk?</p>



<a name="204274896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204274896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204274896">(Jul 18 2020 at 00:40)</a>:</h4>
<p>(as in, in the future)</p>



<a name="204275258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204275258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> roblabla <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204275258">(Jul 18 2020 at 00:48)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> that's the idea yeah</p>



<a name="204275283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204275283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Connor Horman <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204275283">(Jul 18 2020 at 00:49)</a>:</h4>
<p>I use the vendor field generally for the game console itself, though I target more primitive consoles. For example, I use w65c816-snes-none-elf for the SNES.</p>



<a name="204277242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277242">(Jul 18 2020 at 01:37)</a>:</h4>
<p>device name as vendor actually makes so much sense i'm embarrassed</p>



<a name="204277697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Fenrir <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277697">(Jul 18 2020 at 01:48)</a>:</h4>
<p>Even the GBA is a family of multiple devices though</p>



<a name="204277832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277832">(Jul 18 2020 at 01:52)</a>:</h4>
<p>yeah but the <em>software</em> can't tell if it's on a GBA or GBASP or GBA-Player etc</p>



<a name="204277839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Fenrir <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277839">(Jul 18 2020 at 01:52)</a>:</h4>
<p>That's fair then</p>



<a name="204277849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277849">(Jul 18 2020 at 01:53)</a>:</h4>
<p>I think it can actually?</p>



<a name="204277858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Fenrir <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277858">(Jul 18 2020 at 01:53)</a>:</h4>
<p>idk if they can tell in the case of the GBA family</p>



<a name="204277873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204277873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Fenrir <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204277873">(Jul 18 2020 at 01:53)</a>:</h4>
<p>Games can detect if they're on old or new 3DS though</p>



<a name="204278022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278022">(Jul 18 2020 at 01:57)</a>:</h4>
<p>I can't speak outside of GBA, but on the GBA as far as I know you can't tell what hardware you're on.</p>
<p>(Mild Exception: at least one emulator supports debug IO registers which give you a "stdout" sort of ability from within the ROM into a debugger window that the GUI shows. Obviously this is radically different from the normal hardware situation though, so i'm not counting it.)</p>



<a name="204278068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278068">(Jul 18 2020 at 01:58)</a>:</h4>
<p>There's a BIOS function (0xD) that returns BAAE1880 on *DS and BAAE187F on original hardware</p>



<a name="204278105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278105">(Jul 18 2020 at 01:58)</a>:</h4>
<p>And the Gameboy Player has a really fantastic way to detect it: if you display the Gameboy Player logo for 2 seconds then it'll press Up+Down+Left+Right simultaneously</p>



<a name="204278110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278110">(Jul 18 2020 at 01:58)</a>:</h4>
<p>I’m slightly partial to specifying <code>vendor=nintendo</code> for nintendo switch targets just because switch in isolation sounds confusable.</p>



<a name="204278120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278120">(Jul 18 2020 at 01:59)</a>:</h4>
<p>but other than that I don’t think there's  much difference between utilizing the vendor or not.</p>



<a name="204278131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278131">(Jul 18 2020 at 01:59)</a>:</h4>
<p><span class="user-mention" data-user-id="239001">@leo60228</span> very good catch, I'd forgotten about that one.</p>



<a name="204278273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/homebrew%20target%20bikeshedding/near/204278273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/homebrew.20target.20bikeshedding.html#204278273">(Jul 18 2020 at 02:02)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> if you're curious, <a href="https://problemkaputt.de/gbatek.htm#biosfunctions">https://problemkaputt.de/gbatek.htm#biosfunctions</a> has a list of the BIOS functions available on GBA / DS / DSi. You activate them by putting the args in place and triggering a software interrupt, so they're far more expensive to call than a normal function, but a few of them do special enough things to justify the extra cost.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>